import http from './http.js' //引入上面封装好的请求方法

//获取全部歌单信息
export const getMenuAll = data => http({
	url: '/musiclist/getall',
	method: 'post',
	data: data,
})
//根据歌单id获取歌曲列表
export const getbymusiclist = data => http({
	url: `/music/getbymusiclist/${data.id}`,
	method: 'post',
	data: data,
})
//根据id查询歌单信息
export const getbMenuByid = data => http({
	url: `/musiclist/getbyid/${data.id}`,
	method: 'get',
	data: data,
})

//根据id查询当前音乐是否已喜欢
export const getislike = data => http({
	url: `/music/getislike/${data.id}`,
	method: 'post',
	data: data,
})
//添加喜欢歌曲
export const addlike = data => http({
	url: `/music/addlike`,
	method: 'post',
	data: data,
})
//取消喜欢的歌曲
export const detelelike = data => http({
	url: `/music/detelelike`,
	method: 'post',
	data: data,
})
//添加播放记录
export const playrecord = data => http({
	url: `/music/playrecord/insert`,
	method: 'post',
	data: data,
})
//添加播放记录
export const playrecordGetall = data => http({
	url: `/music/playrecord/getall`,
	method: 'post',
	data: data,
})
//搜索
export const musicSearch = data => http({
	url: `/music/search`,
	method: 'post',
	data: data,
})
//查询当前用户创建的歌单
export const musiclistgetallbyuser = data => http({
	url: `/musiclist/getallbyuser`,
	method: 'post',
	data: data,
})
//查询喜欢的歌曲列表
export const getbymylike = data => http({
	url: `/music/getbymylike`,
	method: 'post',
	data: data,
})
//歌单新增歌曲
export const insertbymusiclist = data => http({
	url: `/music/insertbymusiclist`,
	method: 'post',
	data: data,
})
//新增歌单
export const musiclistInsert = data => http({
	url: `/musiclist/insert`,
	method: 'post',
	data: data,
})
//删除歌单
export const musiclistdelete= data => http({
	url: `/musiclist/delete/${data.id}`,
	method: 'get',
	data: data,
})

